<script>
export default {
  name: "HomeView",
  data() {
    return {
      userId: '',
      cartCom: true,
      orderComButton: true,
    };
  },
  mounted() {
    let item = sessionStorage.getItem('user_info');
    if (item != null) {
      this.userId = JSON.parse(item).id;
      this.cartCom = false;
      this.orderComButton = false;
    }

  },
  methods: {}
}
</script>

<template>

  <el-container>
    <el-header>
      <el-menu default-active="goodsShow" mode="horizontal" router>
        <el-menu-item index="/">主界面</el-menu-item>
        <el-menu-item index="/shoppingCart" :disabled="cartCom">购物车</el-menu-item>
        <el-menu-item index="/userOrder" :disabled="orderComButton">订单管理</el-menu-item>
        <el-menu-item index="/userLogin">我的</el-menu-item>
        <el-menu-item index="/ptype">王菲</el-menu-item>
        <el-menu-item index="/shangpin">梁婧娴</el-menu-item>

      </el-menu>

    </el-header>
    <el-main>
      <router-view class="routerViewClass"/>
    </el-main>
  </el-container>

</template>

<style scoped>

@media screen and (min-width: 1000px) {
  .routerViewClass {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }
}

</style>